some mapper tools. these tools rely on map file host
order. Also they rely on map files having their original
mapper generated node names (h0, h1, etc) and not real
hostnames. So don't edit map files. Some tools are specific
to gm and are built in the gm directory. These tools return
0 on failure.


careful_routes 
usage: ./careful_routes <map file>
options:
  --mac-address=<mac address> (to compute routes for just 1 host)
  --num-routes=<num routes per host> (default is 1)
  --num-ports=<num iports> (default is 1)
  --slow (probably optimal results, very slow)

makes a routing file w/ the "careful" routing
algorithm. output goes to stdout. if you specify mac address
the tool will generate just routes for that host, otherwise
it generates routes for the entire cluster. (huge file).


absolute 
usage: absolute <map file> [<route file>]

takes a route file (either from stdin or specified as 2nd
arg on command line) and prints out the route hops as xbar
index:absolute port number.


load_routes
usage: load_routes <map file> <unit> [<route file>]

takes a route file (either specfied or stdin) and loads the
myri board w/ them. Route file can be either a complete
cluster route file (huge) or just the section for this host.

mac_address
usage: mac_address <unit>
prints out the mac address of a board. suitable for using w/
backquotes as a mac_address param to a tool like
careful_routes. e.g.

careful_routes
usage: ./careful_routes <map file>
options:
  --mac-address=<mac address> (to compute routes for just 1 host)
  --num-routes=<num routes per host> (default is 1)
  --num-ports=<num iports> (default is 1)
  --slow (probably optimal results, very slow)

careful_routes ./ncsa.map --mac-address=`../gm/melody/mac_address 0`
1252 hosts and 560 xbars
00:60:dd:7e:d7:37 not found in ./ncsa.map
melody% 


wiring
usage: ./wiring <map file> <xbar file> [iport]
prints out a wiring list given a map file and an xbars file.
w/out more info than a map file and an xbars file contains
the output is not that readable. The problem is knowing
which card an xbar is on, and which line card port an xbar
port corresponds to. to do this requires info about how many
backplane xbars an enclosure has, and also how many line
card slots are currently filled and also which slots happen
to contain spine cards. On a 16 port switch totally populated
w/ switch line cards, the line card number = the xbar number
and the line card port number = the xbar port number -
8. (all indexes are 0-based).

one improvement might be to require another file, a line
card info file, which specifies for each enclosure what kind
of line cards (none, w/xbar, spine) each slot has. This is
about 30 minutes to add if anyone wants it.

ex./wiring ~/big/mute.map ~/big/mute.xbars
761 hosts and 176 xbars
switch 00:60:dd:49:25:63 xbar 11 port 0 <---> switch 00:60:dd:49:25:61 xbar 9 port 13
switch 00:60:dd:49:25:63 xbar 11 port 1 <---> switch 00:60:dd:49:25:61 xbar 2 port 13
switch 00:60:dd:49:25:63 xbar 11 port 2 <---> switch 00:60:dd:49:25:53 xbar 10 port 13
swit


compare compares 2 map files the 2nd a subset hopefully of

Starting program: /nfs/home/finucane/mapper/tools/compare ../gm/a.map ../gm/p.map
594 hosts and 155 xbars
594 hosts and 155 xbars
x0 matches x105
x1 matches x37
x2 matches x45
x3 matches x52
x4 matches x59
x5 matches x66
x6 matches x73

need to add iport param.



